import { View, Text, TextInput, Button } from 'react-native'
import React,{useState} from 'react'


export default function App() {
  let [uname,setUname]=useState('')
  // function doChange(e){
  //   console.log(e.target.value);
  // }
  function doChangeText(value){
    console.log(value);
    setUname(value)
  }
  function doPress(){
    doChangeText()
  }
  return (
    <View style={{backgroundColor:'pink'}}>
      <Text>单行文本输入框</Text>
      <TextInput value={uname} onChangeText={doChangeText} placeholder='请输入用户名'/>
      <Text>单行密码输入框</Text>
      <TextInput secureTextEntry placeholder='请输入密码'/>
      <Text>多行文本输入框</Text>
      <TextInput multiline placeholder='请输入过往经历'/>
      <Button title='提交注册信息' onPress={doPress}></Button>
    </View>
  )
}